import http from './axios'

// 注册
export const Register = registerUser => http('POST', '/user/register', registerUser)
// 登录
export const Login = loginUser => http('POST', '/user/login', loginUser)
// 登出
export const Logout = () => http('GET', '/user/logout')
// 修改用户信息
export const UpdateUser = user => http('PUT', '/user/update', user)
// 获取用户登录信息
export const GetUserLoginInfo = () => http('GET', '/user/info')
// 根据用户ID查询用户信息
export const GetBriefUserById = id => http('GET', '/user/brief/' + id)
// 根据域名获取用户信息
export const GetBriefUserByDomain = domain => http('GET', '/user/domain/' + domain)
// 获取当前用户信息
export const GetDetailedUser = () => http('GET', '/user/detail')
// 根据域名获取用户信息
export const GetRecommendUserList = () => http('GET', '/user/recommend')
// 搜索用户信息
export const GetSearchUserList = (str, time) => http('GET', '/user/search', {
  name: str,
  time
})
// 分页查询粉丝用户
export const GetFollowerPage = (domain, page, size) => http('GET', '/user/follower', {
  domain,
  page,
  size
})
// 分页查询关注用户
export const GetFollowingPage = (domain, page, size) => http('GET', '/user/following', {
  domain,
  page,
  size
})
// 分页查询联络人
export const GetContactUserPage = (page, size) => http('GET', '/user/contact', {
  page,
  size
})
// 分页查询用户信息
export const GetUserPage = (name, page, size) => http('GET', '/user/page', {
  name,
  page,
  size
})
